/*
 * @Author: Hp_lucky 1063512385@qq.com
 * @Date: 2024-08-28 17:41:07
 * @LastEditors: Hp_lucky 1063512385@qq.com
 * @LastEditTime: 2024-09-10 16:21:29
 * @FilePath: \cocos_frame\assets\script\src\Basic\Model\Tips\FlyRightTips.ts
 */
import { _decorator, Layout, RichText } from 'cc';
import { NodeRecycle } from '../../../Manager/PoolManager';
import { autoComp, rootNode } from '../../../Manager/BaseManager';
import { FlyBlackCenterTipsData } from '../TipsDataBase';
const { ccclass } = _decorator;

@ccclass('FlyCenterBlackTips')
export class FlyCenterBlackTips extends NodeRecycle {
  @autoComp(Layout, rootNode)
  layout: Layout;
  @autoComp(RichText)
  details: RichText = null;

  data: FlyBlackCenterTipsData = null;

  protected onEnable(): void {
    this.details.string = this.data.details;
    this.layout.updateLayout();
  }

  reuse(data: FlyBlackCenterTipsData) {
    this.data = data;
  }

  unuse() {
    this.data?.release();
    this.data = null;
  }
}
